package com.czkt.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.czkt.entity.vo.BasDictAndCstCustomer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ConsRptMapper {

    @Select("select b.dict_value,b.dict_item,count(c.cust_level_label)as cust_level_label from bas_dict b left JOIN cst_customer c on c.cust_level = b.dict_value where b.dict_type = '客户等级' GROUP BY b.dict_item,b.dict_value ORDER BY b.dict_value")
    IPage<BasDictAndCstCustomer> selectBasDictByCustomer(IPage<BasDictAndCstCustomer> page);

    @Select("select b.dict_value,b.dict_item,count(c.cust_level_label)as cust_level_label from bas_dict b left JOIN cst_customer c on c.cust_level = b.dict_value where b.dict_type = '客户等级' GROUP BY b.dict_item,b.dict_value ORDER BY b.dict_value")
    List<BasDictAndCstCustomer> selectBasDictByCustomer();
}
